package com.itlaobing.test;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class RelectTest2 {

	public static void main(String[] args) throws ClassNotFoundException,
	InstantiationException, IllegalAccessException, FileNotFoundException, IOException {
		Properties properties=new Properties();
		properties.load(new FileReader("config.properties"));
		System.out.println(properties);
		Class<Person> class1=(Class<Person>) 
				Class.forName(properties.getProperty("type"));
		Person person=class1.newInstance();
		System.out.println(person);
	}
}
